home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / basic / pbasmlib.zip / PBADEMO1.BAS < prev    next >
BASIC Source File  |  1994-02-12  |  6KB  |  160 lines

  1. $include "pbasmlib.inc"
  2. $link "pbasmlib.pbl"
  3.  
  4. 'PBASMLIB Demo #1
  5. '(C) Copyright 1993 by Tim Gerchmez
  6. 'All Rights Reserved.
  7. '
  8. 'Written 12/15/93, revised 2/94
  9. '
  10.  
  11. fadeout 20
  12. cls
  13. locate 2,26:print "PBASMLIB Demo #1"
  14. locate 3,26:print "----------------"
  15. print:print "This is a demonstration of the SBFMPLAY routine in the PBASMLIB Sound"
  16. print "module.  The Sound module lets you play FM synthesized music (all 9 voices)"
  17. print "directly from BASIC - without loading an external driver.  This means that"
  18. print "you can use a command similar to PB's PLAY command, but play from the "
  19. print "Soundblaster rather than the PC speaker!  PBASMLIB also includes hundreds "
  20. print "of other routines, all written in fast, tight assembly language for "
  21. print "unparallelled speed and power.  You can interface directly to MS-DOS, the "
  22. print "ROM BIOS and the mouse driver, as well as perform many other low-level "
  23. print "functions with ease!"
  24. print
  25. print "(1) Edelweiss                (5) Aloha Oe        (9) Try to Remember"
  26. print "(2) We've Got Tonight        (6) Born Free       (A) Send in the Clowns"
  27. print "(3) Puff the Magic Dragon    (7) Greensleeves    (B) Memory"
  28. print "(4) Minuet                   (8) Let it be Me    (C) Yesterday":print
  29. print "The Sound module in PBASMLIB adds only a bit over 8K of code to your"
  30. print "PowerBASIC program, yet gives you access to all the power of the"
  31. print "Soundblaster's FM music capabilities!  You can also write programs that"
  32. print "TALK if you load the SB speech driver first.";
  33. fadein 20
  34.  
  35. readypoint:
  36. while inkey$<>"":wend
  37. keypoint:
  38. do
  39.     a$=inkey$
  40. loop while a$=""
  41. if a$=chr$(27) then fadeout 20:cls:blankin:end
  42. if sbdetect=0 then cls:print:print "Soundblaster required - sorry.":end
  43. if lcase$(a$)="a" then gosub clowns:goto keypoint
  44. if lcase$(a$)="b" then gosub memory:goto keypoint
  45. if lcase$(a$)="c" then gosub yesterday:goto keypoint
  46. if a$<"1" or a$>"9" then goto keypoint
  47. on val(a$) gosub edel,tonight,puff,minuet,aloha,born,green,beme,remember
  48. goto readypoint
  49.  
  50.  
  51. 'Greensleeves
  52. green:
  53. a$="p6n7d h8f r.g a b-a h0g r.e c d e h8f r.d d c#d h5e r.c#o4a r."
  54. b$=p$+"o5d h8f r.g a b-a h0g r.e c d e h8f e d h5c#o4b o5c#h8d r.r.r.r."
  55. c$="h3o6c r.c c o5b a h0g r.e c d e h8f r.d d c#d h5e r.c#o4a r.r."
  56. d$="o5h3o6c r.c c o5b a h0g r.e c d e h8f e d h5c#o4b o5c#h8d r.r.r.r."
  57. sbfmplay a$+b$+c$+d$
  58. return
  59.  
  60. 'Minuet
  61. minuet:
  62. bar1$="t3o4w4h0g r.c d e f h0g r.c r.c r.h3a r.f g a b h0o5c r.o4c r.c r."
  63. bar2$="h4f r.g f e d h0e r.f e d c ":bar3$="o3b r.o4c d e c h4d r.r.r.r."
  64. bar4$="h4d r.e d c o3b o4h0c r.r.r.r."
  65. sbfmplay bar1$+bar2$+bar3$+bar1$+bar2$+bar4$
  66. return
  67.  
  68. 'Ahoha Oe
  69. Aloha:
  70. bar1$="n7t0i1p5w6g h3a r.o6c r.f r.r.o5a h0g r.o6c r.e r.r.c "
  71. bar2$="o5h4b r2a b o6c d d f f o5h0o6e r.c r.o5g r.r."
  72. bar3$="o5h4b r.o6c r.e d o5b g h0o6c r.r.r."
  73. sbfmplay bar1$+bar2$+bar1$+bar3$
  74. return
  75.  
  76. 'Puff the Magic Dragon
  77. puff:
  78. bar1$="n8s0t3h3w7f r3w4f w7f f hce r.c r.hid r.f f h3c r.r.c "
  79. bar2$="o4hib-b-o5c o4b-h3a o5c f w4f f "
  80. bar3$="w7h4f d e f h0g r.r.r."
  81. bar4$="w7h4d f h0e g h3f r.r.r."
  82. sbfmplay bar1$+bar2$+bar3$+bar1$+bar2$+bar4$
  83. return
  84.  
  85. 'We've got tonight
  86. tonight:
  87. bar1$="p6s1n8o5b a g h4d r.rh1.r.r.b a g h0d d r.r.h1r.r."
  88. bar2$="b o6d o5b h4o6d r.rh0.r.r.e d c o5h4o6d r.r.o5h1o6r.r."
  89. bar3$="o5b o6d o5b h4o6d r.r.o5w2b a g w5r.r.h0r.r.b a g h4g r.r.r.r.r."
  90. sbfmplay bar1$+bar2$+bar1$+bar3$
  91. return
  92.  
  93. 'Born free
  94. born:
  95. bar1$="p4w7n3n8t2h0o5c r.r.o4g r.r.h3r.r.g a g f h0e r.r.c r.r.h3r.r.g a g f h9b r.r.g r.e "
  96. bar2$="h4f r.f f e d h0e r.r.r.r.r.r.r.r."
  97. bar3$="h4g r.g g a g h4b r.r.r.r.r.r.r.r."
  98. bar4$="o5h8d r.r.o4a r.r.r.r.a b a g hce r.r.o5c r.r.r.r.c d o4a o5c h3d r.c d r.c h1d r.c d r.c h4d r.r.r.r.r.r.r.r."
  99. bar5$="h8o5c r.r.c r.r.o4h0o5c r.r.r.r.r.r.r.r."
  100. sbfmplay bar1$+bar2$+bar1$+bar3$+bar4$+bar1$+bar5$
  101. return
  102.  
  103. 'Edelweiss
  104. edel:
  105. bar1$="i1n1h0e r.g h4o6d r.r.o5h0o6c r.o5g h3f r.r.h0e r."
  106. bar2$="e hce f g h8a r.r.h4g r.r."
  107. bar3$="g h4g a b h0o6c v2o5g v1o6v2o5e v1o5h0v2c v1o6r.r."
  108. bar4$="o5h4o6d o5g g b a g h0e r.g o6c r.r.o5h3a r.o6c o5h1o6d r.c o5h4b r.r.g r.r."
  109. bar5$="h0e r.g hbo6d r.r.o5h3o6c r.o5g haf r.r.h0e r."
  110. sbfmplay bar1$+bar2$+bar1$+bar3$+bar4$+bar5$+bar3$
  111. return
  112.  
  113. 'Let it be me
  114.  
  115. beme:
  116.  
  117. bar1$="p7n7n2w4h3r.a a a h0o6x6c r.o5w2b-w4a g h8r.f g a x6hca r.w2g w4f e hir.d f g x6h3f r.c r.hbr.f h0f e h3f r.r.r."
  118. bar2$="hio6r.d d d o5hco6c r.o5a r.hir.o6d e d o5h3o6c r.o5a r.r.hbb-o6c d o5h3o6c r.o5f r.hir.f g a h5a r.r.r."
  119. sbfmplay bar1$+bar1$+bar2$+bar1$
  120. return
  121.  
  122. 'Try to Remember
  123. remember:
  124.  
  125. bar1$="h3n3n8w6a a a a g f hbo4b-b-b-h0b-o5c d "
  126. bar2$="w6h3c r.o4a o5f r.c hbd r.o4b-o5h0g d r."
  127. bar3$="w6o6hcc c c h8c o5b-a hbb-b-b-h0b-a g h3a a a hia g f hbg r.d h0e c r."
  128. bar4$="w6h3a f w4a f hia f a f a f w8h3a f r.r.r."
  129. sbfmplay bar1$+bar2$+bar1$+bar2$+bar3$+bar1$+bar4$
  130. return
  131.  
  132. 'Send in the clowns
  133. clowns:
  134. bar1$="w8n1n8i2o4b-o5c f h3f r.r.r.hir.o4b-o5c f h3f r.r.r."
  135. bar2$="g a f g a a a r.r.r.a a o6c o5c hid r.r.r.r."
  136. bar3$="d f o4b-o5h0c r.r.r.r.d f e h3f r.r.r.r.r."
  137. sbfmplay bar1$+bar2$+bar3$
  138. return
  139.  
  140. 'Memory
  141. memory:
  142.  
  143. bar1$="v4i1v5i1v6i1v1i2t0s1w6n8h0o6c r.c r.r.r.o5b o6c d c o5a hco6c r.r.c r.r.r."
  144. bar2$="o5b o6c d c o5g h3a r.r.a r.r.r.f g a g f h9e r.r.r.r.r.r."
  145. bar3$="o5e g h8g r.r.d r.e f r.g a r.b hco6c o5b a g r.r.r.r."
  146. bar4$="o5e c h4g r.r.g r.r.r.r.o4a a b o5c h0c r.r.r.r.r."
  147. sbfmplay bar1$+bar2$+bar3$+bar4$
  148. return
  149.  
  150. yesterday:
  151. bar0$="w6p5t3v4i1v5i1v6i1v1n3n8"
  152. bar1$="o4h3g w4f w6f r.r.r.r.h5r.r.a b o5w4c#w6d e f h8e r.d d r.r.r."
  153. bar2$="hir.r.d d h0c o4b-a g h3b-r.a a r.g r.h8f r.a r.h4g r.d r.hif r.h3a a r.r.r.r."
  154. bar3$="t3o4h5a r.r.r.a r.r.r.o5h8d r.e r.hif r.e d h0e r.r."
  155. bar4$="d w4c w6d r.w5r.w6o4h3a r.r.r.r.r.r."
  156. bar5$="d c r.e r.h3f r.c r.o4b-r.a r."
  157. bar6$="h8f r.a r.h4g r.d r.hif r.h3a a r.r.r.r.r.r."
  158. sbfmplay bar0$+bar1$+bar2$+bar1$+bar2$+bar3$+bar4$+bar3$+bar5$+bar1$+bar2$+bar6$
  159. return
  160.